/// code : 200
/// message : "OK"
/// data : [{"id":1,"title":"揚帆","level":1,"group_buy":true},{"id":2,"title":"綻放","level":2,"group_buy":true},{"id":3,"title":"拔萃","level":3,"group_buy":true}]

class UnitGroupBean {
  int _code;
  String _message;
  List<UnitBean> _data;

  int get code => _code;
  String get message => _message;
  List<UnitBean> get data => _data;

  UnitGroupBean({
      int code, 
      String message, 
      List<UnitBean> data}){
    _code = code;
    _message = message;
    _data = data;
}

  UnitGroupBean.fromJson(dynamic json) {
    _code = json["code"];
    _message = json["message"];
    if (json["data"] != null) {
      _data = [];
      json["data"].forEach((v) {
        _data.add(UnitBean.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["code"] = _code;
    map["message"] = _message;
    if (_data != null) {
      map["data"] = _data.map((v) => v.toJson()).toList();
    }
    return map;
  }

}

/// id : 1
/// title : "揚帆"
/// level : 1
/// group_buy : true

class UnitBean {
  int _id;
  String _title;
  int _level;
  bool _groupBuy;

  int get id => _id;
  String get title => _title;
  int get level => _level;
  bool get groupBuy => _groupBuy;

  UnitBean({
      int id, 
      String title, 
      int level, 
      bool groupBuy}){
    _id = id;
    _title = title;
    _level = level;
    _groupBuy = groupBuy;
}

  UnitBean.fromJson(dynamic json) {
    _id = json["id"];
    _title = json["title"];
    _level = json["level"];
    _groupBuy = json["group_buy"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"] = _id;
    map["title"] = _title;
    map["level"] = _level;
    map["group_buy"] = _groupBuy;
    return map;
  }

}